package com.devmindset.jpatoolbox.onetomany;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.devmindset.jpatoolbox.base.BaseEntity;


/**
 * Entity on the forward side used in the 1-to-M wiring tests.
 *
 * @author <a href="mailto:ice.penov@devmindset.com">Ice Penov</a>
 */
@Entity(name = "FORWARD_1M")
@Table(name = "FORWARD_1M")
public class Forward extends BaseEntity {
  
  @ManyToOne(cascade = CascadeType.ALL)
  private Inverse inverse;

  public Inverse getInverse() {
    return inverse;
  }

  public void setInverse(Inverse inverse) {
    com.devmindset.jpatoolbox.OneToManyUtil.wireUnarySide(this, inverse, Forward.class, Inverse.class);
  }      

}
